// -----------------------------
// Author: 		Dhaenens Gert 
// Creation: 	8/6/2013 10:50:54 PM				
// -----------------------------

#ifndef _LuaMethodMethodSafeCall_h
#define _LuaMethodMethodSafeCall_h

#include "Lua.h"
#include "LuaDataType.h"

namespace ObjectLua
{

	namespace Internal
	{

		/*
		//	Method used to safely call
		//	Methods wich could possibly
		//	have a void return type
		//	0 Arguments
		*/
		template<typename Class, typename R>
		struct MethodSafeCall_0
		{
			int operator()(Lua* lpLua, R (Class::*lpMethod)())
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				R returnArg = (*lpObject.*lpMethod)();
				LuaDataType<R>::push(lpLua,returnArg);
				return 1;
			}
		};
		template<typename Class>
		struct MethodSafeCall_0<Class,void>
		{
			int operator()(Lua* lpLua, void (Class::*lpMethod)())
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				(*lpObject.*lpMethod)();
				return 0;
			}
		};



		/*
		//	Method used to safely call
		//	Methods wich could possibly
		//	have a void return type
		//	1 Argument
		*/
		template<typename Class, typename R, typename P0>
		struct MethodSafeCall_1
		{
			int operator()(Lua* lpLua, R (Class::*lpMethod)(P0))
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				R returnArg = (*lpObject.*lpMethod)(arg0);
				LuaDataType<R>::push(lpLua,returnArg);
				return 1;
			}
		};
		template<typename Class, typename P0>
		struct MethodSafeCall_1<Class,void,P0>
		{
			int operator()(Lua* lpLua, void (Class::*lpMethod)(P0))
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				(*lpObject.*lpMethod)(arg0);
				return 0;
			}
		};



		/*
		//	Method used to safely call
		//	Methods wich could possibly
		//	have a void return type
		//	2 Arguments
		*/
		template<typename Class, typename R, typename P0, typename P1>
		struct MethodSafeCall_2
		{
			int operator()(Lua* lpLua, R (Class::*lpMethod)(P0,P1))
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				P1 arg1 = LuaDataType<P1>::get(lpLua,3);
				R returnArg = (*lpObject.*lpMethod)(arg0,arg1);
				LuaDataType<R>::push(lpLua,returnArg);
				return 1;
			}
		};
		template<typename Class, typename P0, typename P1>
		struct MethodSafeCall_2<Class,void,P0,P1>
		{
			int operator()(Lua* lpLua, void (Class::*lpMethod)(P0,P1))
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				P1 arg1 = LuaDataType<P1>::get(lpLua,3);
				(*lpObject.*lpMethod)(arg0,arg1);
				return 0;
			}
		};



		/*
		//	Method used to safely call
		//	Methods wich could possibly
		//	have a void return type
		//	3 Arguments
		*/
		template<typename Class, typename R, typename P0, typename P1, typename P2>
		struct MethodSafeCall_3
		{
			int operator()(Lua* lpLua, R (Class::*lpMethod)(P0,P1,P2))
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				P1 arg1 = LuaDataType<P1>::get(lpLua,3);
				P2 arg2 = LuaDataType<P2>::get(lpLua,4);
				R returnArg = (*lpObject.*lpMethod)(arg0,arg1,arg2);
				LuaDataType<R>::push(lpLua,returnArg);
				return 1;
			}
		};
		template<typename Class, typename P0, typename P1, typename P2>
		struct MethodSafeCall_3<Class,void,P0,P1,P2>
		{
			int operator()(Lua* lpLua, void (Class::*lpMethod)(P0,P1,P2))
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				P1 arg1 = LuaDataType<P1>::get(lpLua,3);
				P2 arg2 = LuaDataType<P2>::get(lpLua,4);
				(*lpObject.*lpMethod)(arg0,arg1,arg2);
				return 0;
			}
		};



		/*
		//	Method used to safely call
		//	Methods wich could possibly
		//	have a void return type
		//	4 Arguments
		*/
		template<typename Class, typename R, typename P0, typename P1, typename P2, typename P3>
		struct MethodSafeCall_4
		{
			int operator()(Lua* lpLua, R (Class::*lpMethod)(P0,P1,P2,P3))
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				P1 arg1 = LuaDataType<P1>::get(lpLua,3);
				P2 arg2 = LuaDataType<P2>::get(lpLua,4);
				P3 arg3 = LuaDataType<P3>::get(lpLua,5);
				R returnArg = (*lpObject.*lpMethod)(arg0,arg1,arg2,arg3);
				LuaDataType<R>::push(lpLua,returnArg);
				return 1;
			}
		};
		template<typename Class, typename P0, typename P1, typename P2, typename P3>
		struct MethodSafeCall_4<Class,void,P0,P1,P2,P3>
		{
			int operator()(Lua* lpLua, void (Class::*lpMethod)(P0,P1,P2,P3))
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				P1 arg1 = LuaDataType<P1>::get(lpLua,3);
				P2 arg2 = LuaDataType<P2>::get(lpLua,4);
				P3 arg3 = LuaDataType<P3>::get(lpLua,5);
				(*lpObject.*lpMethod)(arg0,arg1,arg2,arg3);
				return 0;
			}
		};



		/*
		//	Method used to safely call
		//	Methods wich could possibly
		//	have a void return type
		//	5 Arguments
		*/
		template<typename Class, typename R, typename P0, typename P1, typename P2, typename P3, typename P4>
		struct MethodSafeCall_5
		{
			int operator()(Lua* lpLua, R (Class::*lpMethod)(P0,P1,P2,P3,P4))
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				P1 arg1 = LuaDataType<P1>::get(lpLua,3);
				P2 arg2 = LuaDataType<P2>::get(lpLua,4);
				P3 arg3 = LuaDataType<P3>::get(lpLua,5);
				P4 arg4 = LuaDataType<P4>::get(lpLua,6);
				R returnArg = (*lpObject.*lpMethod)(arg0,arg1,arg2,arg3,arg4);
				LuaDataType<R>::push(lpLua,returnArg);
				return 1;
			}
		};
		template<typename Class, typename P0, typename P1, typename P2, typename P3, typename P4>
		struct MethodSafeCall_5<Class,void,P0,P1,P2,P3,P4>
		{
			int operator()(Lua* lpLua, void (Class::*lpMethod)(P0,P1,P2,P3,P4))
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				P1 arg1 = LuaDataType<P1>::get(lpLua,3);
				P2 arg2 = LuaDataType<P2>::get(lpLua,4);
				P3 arg3 = LuaDataType<P3>::get(lpLua,5);
				P4 arg4 = LuaDataType<P4>::get(lpLua,6);
				(*lpObject.*lpMethod)(arg0,arg1,arg2,arg3,arg4);
				return 0;
			}
		};



		/*
		//	Method used to safely call
		//	Methods wich could possibly
		//	have a void return type
		//	6 Arguments
		*/
		template<typename Class, typename R, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5>
		struct MethodSafeCall_6
		{
			int operator()(Lua* lpLua, R (Class::*lpMethod)(P0,P1,P2,P3,P4,P5))
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				P1 arg1 = LuaDataType<P1>::get(lpLua,3);
				P2 arg2 = LuaDataType<P2>::get(lpLua,4);
				P3 arg3 = LuaDataType<P3>::get(lpLua,5);
				P4 arg4 = LuaDataType<P4>::get(lpLua,6);
				P5 arg5 = LuaDataType<P5>::get(lpLua,7);
				R returnArg = (*lpObject.*lpMethod)(arg0,arg1,arg2,arg3,arg4,arg5);
				LuaDataType<R>::push(lpLua,returnArg);
				return 1;
			}
		};
		template<typename Class, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5>
		struct MethodSafeCall_6<Class,void,P0,P1,P2,P3,P4,P5>
		{
			int operator()(Lua* lpLua, void (Class::*lpMethod)(P0,P1,P2,P3,P4,P5))
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				P1 arg1 = LuaDataType<P1>::get(lpLua,3);
				P2 arg2 = LuaDataType<P2>::get(lpLua,4);
				P3 arg3 = LuaDataType<P3>::get(lpLua,5);
				P4 arg4 = LuaDataType<P4>::get(lpLua,6);
				P5 arg5 = LuaDataType<P5>::get(lpLua,7);
				(*lpObject.*lpMethod)(arg0,arg1,arg2,arg3,arg4,arg5);
				return 0;
			}
		};



		/*
		//	Method used to safely call
		//	Methods wich could possibly
		//	have a void return type
		//	7 Arguments
		*/
		template<typename Class, typename R, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
		struct MethodSafeCall_7
		{
			int operator()(Lua* lpLua, R (Class::*lpMethod)(P0,P1,P2,P3,P4,P5,P6))
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				P1 arg1 = LuaDataType<P1>::get(lpLua,3);
				P2 arg2 = LuaDataType<P2>::get(lpLua,4);
				P3 arg3 = LuaDataType<P3>::get(lpLua,5);
				P4 arg4 = LuaDataType<P4>::get(lpLua,6);
				P5 arg5 = LuaDataType<P5>::get(lpLua,7);
				P6 arg6 = LuaDataType<P6>::get(lpLua,8);
				R returnArg = (*lpObject.*lpMethod)(arg0,arg1,arg2,arg3,arg4,arg5,arg6);
				LuaDataType<R>::push(lpLua,returnArg);
				return 1;
			}
		};
		template<typename Class, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
		struct MethodSafeCall_7<Class,void,P0,P1,P2,P3,P4,P5,P6>
		{
			int operator()(Lua* lpLua, void (Class::*lpMethod)(P0,P1,P2,P3,P4,P5,P6))
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				P1 arg1 = LuaDataType<P1>::get(lpLua,3);
				P2 arg2 = LuaDataType<P2>::get(lpLua,4);
				P3 arg3 = LuaDataType<P3>::get(lpLua,5);
				P4 arg4 = LuaDataType<P4>::get(lpLua,6);
				P5 arg5 = LuaDataType<P5>::get(lpLua,7);
				P6 arg6 = LuaDataType<P6>::get(lpLua,8);
				(*lpObject.*lpMethod)(arg0,arg1,arg2,arg3,arg4,arg5,arg6);
				return 0;
			}
		};










		/*
		//	Method used to safely call
		//	Methods wich could possibly
		//	have a void return type
		//	0 Arguments
		*/
		template<typename Class, typename R>
		struct ConstMethodSafeCall_0
		{
			int operator()(Lua* lpLua, R (Class::*lpMethod)() const)
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				R returnArg = (*lpObject.*lpMethod)();
				LuaDataType<R>::push(lpLua,returnArg);
				return 1;
			}
		};
		template<typename Class>
		struct ConstMethodSafeCall_0<Class,void>
		{
			int operator()(Lua* lpLua, void (Class::*lpMethod)() const)
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				(*lpObject.*lpMethod)();
				return 0;
			}
		};



		/*
		//	Method used to safely call
		//	Methods wich could possibly
		//	have a void return type
		//	1 Argument
		*/
		template<typename Class, typename R, typename P0>
		struct ConstMethodSafeCall_1
		{
			int operator()(Lua* lpLua, R (Class::*lpMethod)(P0) const)
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				R returnArg = (*lpObject.*lpMethod)(arg0);
				LuaDataType<R>::push(lpLua,returnArg);
				return 1;
			}
		};
		template<typename Class, typename P0>
		struct ConstMethodSafeCall_1<Class,void,P0>
		{
			int operator()(Lua* lpLua, void (Class::*lpMethod)(P0) const)
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				(*lpObject.*lpMethod)(arg0);
				return 0;
			}
		};



		/*
		//	Method used to safely call
		//	Methods wich could possibly
		//	have a void return type
		//	2 Arguments
		*/
		template<typename Class, typename R, typename P0, typename P1>
		struct ConstMethodSafeCall_2
		{
			int operator()(Lua* lpLua, R (Class::*lpMethod)(P0,P1) const)
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				P1 arg1 = LuaDataType<P1>::get(lpLua,3);
				R returnArg = (*lpObject.*lpMethod)(arg0,arg1);
				LuaDataType<R>::push(lpLua,returnArg);
				return 1;
			}
		};
		template<typename Class, typename P0, typename P1>
		struct ConstMethodSafeCall_2<Class,void,P0,P1>
		{
			int operator()(Lua* lpLua, void (Class::*lpMethod)(P0,P1) const)
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				P1 arg1 = LuaDataType<P1>::get(lpLua,3);
				(*lpObject.*lpMethod)(arg0,arg1);
				return 0;
			}
		};



		/*
		//	Method used to safely call
		//	Methods wich could possibly
		//	have a void return type
		//	3 Arguments
		*/
		template<typename Class, typename R, typename P0, typename P1, typename P2>
		struct ConstMethodSafeCall_3
		{
			int operator()(Lua* lpLua, R (Class::*lpMethod)(P0,P1,P2) const)
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				P1 arg1 = LuaDataType<P1>::get(lpLua,3);
				P2 arg2 = LuaDataType<P2>::get(lpLua,4);
				R returnArg = (*lpObject.*lpMethod)(arg0,arg1,arg2);
				LuaDataType<R>::push(lpLua,returnArg);
				return 1;
			}
		};
		template<typename Class, typename P0, typename P1, typename P2>
		struct ConstMethodSafeCall_3<Class,void,P0,P1,P2>
		{
			int operator()(Lua* lpLua, void (Class::*lpMethod)(P0,P1,P2) const)
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				P1 arg1 = LuaDataType<P1>::get(lpLua,3);
				P2 arg2 = LuaDataType<P2>::get(lpLua,4);
				(*lpObject.*lpMethod)(arg0,arg1,arg2);
				return 0;
			}
		};



		/*
		//	Method used to safely call
		//	Methods wich could possibly
		//	have a void return type
		//	4 Arguments
		*/
		template<typename Class, typename R, typename P0, typename P1, typename P2, typename P3>
		struct ConstMethodSafeCall_4
		{
			int operator()(Lua* lpLua, R (Class::*lpMethod)(P0,P1,P2,P3) const)
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				P1 arg1 = LuaDataType<P1>::get(lpLua,3);
				P2 arg2 = LuaDataType<P2>::get(lpLua,4);
				P3 arg3 = LuaDataType<P3>::get(lpLua,5);
				R returnArg = (*lpObject.*lpMethod)(arg0,arg1,arg2,arg3);
				LuaDataType<R>::push(lpLua,returnArg);
				return 1;
			}
		};
		template<typename Class, typename P0, typename P1, typename P2, typename P3>
		struct ConstMethodSafeCall_4<Class,void,P0,P1,P2,P3>
		{
			int operator()(Lua* lpLua, void (Class::*lpMethod)(P0,P1,P2,P3) const)
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				P1 arg1 = LuaDataType<P1>::get(lpLua,3);
				P2 arg2 = LuaDataType<P2>::get(lpLua,4);
				P3 arg3 = LuaDataType<P3>::get(lpLua,5);
				(*lpObject.*lpMethod)(arg0,arg1,arg2,arg3);
				return 0;
			}
		};



		/*
		//	Method used to safely call
		//	Methods wich could possibly
		//	have a void return type
		//	5 Arguments
		*/
		template<typename Class, typename R, typename P0, typename P1, typename P2, typename P3, typename P4>
		struct ConstMethodSafeCall_5
		{
			int operator()(Lua* lpLua, R (Class::*lpMethod)(P0,P1,P2,P3,P4) const)
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				P1 arg1 = LuaDataType<P1>::get(lpLua,3);
				P2 arg2 = LuaDataType<P2>::get(lpLua,4);
				P3 arg3 = LuaDataType<P3>::get(lpLua,5);
				P4 arg4 = LuaDataType<P4>::get(lpLua,6);
				R returnArg = (*lpObject.*lpMethod)(arg0,arg1,arg2,arg3,arg4);
				LuaDataType<R>::push(lpLua,returnArg);
				return 1;
			}
		};
		template<typename Class, typename P0, typename P1, typename P2, typename P3, typename P4>
		struct ConstMethodSafeCall_5<Class,void,P0,P1,P2,P3,P4>
		{
			int operator()(Lua* lpLua, void (Class::*lpMethod)(P0,P1,P2,P3,P4) const)
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				P1 arg1 = LuaDataType<P1>::get(lpLua,3);
				P2 arg2 = LuaDataType<P2>::get(lpLua,4);
				P3 arg3 = LuaDataType<P3>::get(lpLua,5);
				P4 arg4 = LuaDataType<P4>::get(lpLua,6);
				(*lpObject.*lpMethod)(arg0,arg1,arg2,arg3,arg4);
				return 0;
			}
		};



		/*
		//	Method used to safely call
		//	Methods wich could possibly
		//	have a void return type
		//	6 Arguments
		*/
		template<typename Class, typename R, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5>
		struct ConstMethodSafeCall_6
		{
			int operator()(Lua* lpLua, R (Class::*lpMethod)(P0,P1,P2,P3,P4,P5) const)
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				P1 arg1 = LuaDataType<P1>::get(lpLua,3);
				P2 arg2 = LuaDataType<P2>::get(lpLua,4);
				P3 arg3 = LuaDataType<P3>::get(lpLua,5);
				P4 arg4 = LuaDataType<P4>::get(lpLua,6);
				P5 arg5 = LuaDataType<P5>::get(lpLua,7);
				R returnArg = (*lpObject.*lpMethod)(arg0,arg1,arg2,arg3,arg4,arg5);
				LuaDataType<R>::push(lpLua,returnArg);
				return 1;
			}
		};
		template<typename Class, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5>
		struct ConstMethodSafeCall_6<Class,void,P0,P1,P2,P3,P4,P5>
		{
			int operator()(Lua* lpLua, void (Class::*lpMethod)(P0,P1,P2,P3,P4,P5) const)
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				P1 arg1 = LuaDataType<P1>::get(lpLua,3);
				P2 arg2 = LuaDataType<P2>::get(lpLua,4);
				P3 arg3 = LuaDataType<P3>::get(lpLua,5);
				P4 arg4 = LuaDataType<P4>::get(lpLua,6);
				P5 arg5 = LuaDataType<P5>::get(lpLua,7);
				(*lpObject.*lpMethod)(arg0,arg1,arg2,arg3,arg4,arg5);
				return 0;
			}
		};



		/*
		//	Method used to safely call
		//	Methods wich could possibly
		//	have a void return type
		//	7 Arguments
		*/
		template<typename Class, typename R, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
		struct ConstMethodSafeCall_7
		{
			int operator()(Lua* lpLua, R (Class::*lpMethod)(P0,P1,P2,P3,P4,P5,P6) const)
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				P1 arg1 = LuaDataType<P1>::get(lpLua,3);
				P2 arg2 = LuaDataType<P2>::get(lpLua,4);
				P3 arg3 = LuaDataType<P3>::get(lpLua,5);
				P4 arg4 = LuaDataType<P4>::get(lpLua,6);
				P5 arg5 = LuaDataType<P5>::get(lpLua,7);
				P6 arg6 = LuaDataType<P6>::get(lpLua,8);
				R returnArg = (*lpObject.*lpMethod)(arg0,arg1,arg2,arg3,arg4,arg5,arg6);
				LuaDataType<R>::push(lpLua,returnArg);
				return 1;
			}
		};
		template<typename Class, typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
		struct ConstMethodSafeCall_7<Class,void,P0,P1,P2,P3,P4,P5,P6>
		{
			int operator()(Lua* lpLua, void (Class::*lpMethod)(P0,P1,P2,P3,P4,P5,P6) const)
			{
				Class* lpObject = LuaDataType<Class*>::get(lpLua,1);
				
				P0 arg0 = LuaDataType<P0>::get(lpLua,2);
				P1 arg1 = LuaDataType<P1>::get(lpLua,3);
				P2 arg2 = LuaDataType<P2>::get(lpLua,4);
				P3 arg3 = LuaDataType<P3>::get(lpLua,5);
				P4 arg4 = LuaDataType<P4>::get(lpLua,6);
				P5 arg5 = LuaDataType<P5>::get(lpLua,7);
				P6 arg6 = LuaDataType<P6>::get(lpLua,8);
				(*lpObject.*lpMethod)(arg0,arg1,arg2,arg3,arg4,arg5,arg6);
				return 0;
			}
		};
	}

}

#endif